home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
cddk9606.zip
/
HEADERS.ARJ
/
SLICER.INT
< prev
next >
Wrap
Text File
|
1996-06-14
|
9KB
|
371 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ SLICER: Time-slicing support }
{ Copyright 1996 David Pinch ∙ All Rights Reserved Worldwide }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Slicer;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
CONST
_DOS = 0;
_DesqView = 1;
_DoubleDOS = 2;
_OS2 = 3;
_TopView = 4;
_Windows = 5;
{#Start}
FUNCTION DesqView:Boolean;
{
PURPOSE : Returns TRUE if DesqView is installed, FALSE if not.
SEE ALSO : DOSShell, DoubleDOS, OS2, TopView, Windows, Windows_Real
}
FUNCTION DesqView_Version:Word;
{
PURPOSE : Returns the version of DesqView.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. This function properly
handles the version bug found in some early copies of
DesqView 2.0.
SEE ALSO : DOS_Version, DoubleDOS_Version, OS2_Version,
TopView_Version, Windows_Version
}
FUNCTION DOSShell:Boolean;
{
PURPOSE : Returns TRUE if the DOS 5+ task switcher is loaded.
SEE ALSO : DesqView, DoubleDOS, OS2, TopView, Windows, Windows_Real
}
PROCEDURE DOS_Release;
{
PURPOSE : Notifies DOS that the program is idle.
SEE ALSO : Release, DoubleDOS_Release, TopView_Release, Windows_Release
}
FUNCTION DOS_Version:Word;
{
PURPOSE : Returns the version of DOS on the local computer.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte.
SEE ALSO : DesqView_Version, DoubleDOS_Version, OS2_Version,
TopView_Version, Windows_Version
}
FUNCTION DoubleDOS:Boolean;
{
PURPOSE : Returns TRUE is DoubleDOS is installed, FALSE if not.
SEE ALSO : DesqView, DOSShell, OS2, TopView, Windows, Windows_Real
}
PROCEDURE DoubleDOS_CriticalBegin;
{
PURPOSE : Disables multitasking in DoubleDOS.
SEE ALSO : DoubleDOS_CriticalEnd
}
PROCEDURE DoubleDOS_CriticalEnd;
{
PURPOSE : Enables multitasking in DoubleDOS.
SEE ALSO : DoubleDOS_CriticalBegin
}
PROCEDURE DoubleDOS_Release;
{
PURPOSE : Releases a single 55 ms timeslice back to DoubleDOS
SEE ALSO : Release, DOS_Release, TopView_Release, Windows_Release
}
FUNCTION DoubleDOS_Version:Word;
{
PURPOSE : This dummy function always returns 0. Please contact
the author if you have technical information on the
DoubleDOS multitasker.
SEE ALSO : DesqView_Version, DOS_Version, OS2_Version,
TopView_Version, Windows_Version
}
FUNCTION OS2:Boolean;
{
PURPOSE : Returns TRUE if OS/2 (Operating System/2) is detected on
the local computer.
SEE ALSO : DesqView, DOSShell, DoubleDOS, TopView, Windows, Windows_Real
}
FUNCTION OS2_Version:Word;
{
PURPOSE : Returns the version of OS/2.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. The return value
of $0302 (2.3) is remapped to $0003 (3.0).
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version,
TopView_Version, Windows_Version
}
FUNCTION TopView:Boolean;
{
PURPOSE : Returns TRUE if TopView or compatible is loaded.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, Windows, Windows_Real
}
PROCEDURE TopView_CriticalBegin;
{
PURPOSE : Disables task-switching in TopView or DesqView.
SEE ALSO : TopView_CriticalEnd
}
PROCEDURE TopView_CriticalEnd;
{
PURPOSE : Enables task-switching in TopView or DesqView.
SEE ALSO : TopView_CriticalBegin
}
PROCEDURE TopView_Release;
{
PURPOSE : Releases the current timeslice back to TopView or DesqView.
SEE ALSO : Release, DOS_Release, DoubleDOS_Release, Windows_Release
}
FUNCTION TopView_Version:Word;
{
PURPOSE : Returns the version of TopView.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte.
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version, OS2_Version,
Windows_Version
}
FUNCTION Windows:Boolean;
{
PURPOSE : Returns TRUE if Windows 3.x, Windows 95 or Windows NT is
detected on the local computer.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, TopView, Windows_Real
}
PROCEDURE Windows_CriticalBegin;
{
PURPOSE : Disables task switching in Windows 3.0+
SEE ALSO : Windows_CriticalEnd
}
PROCEDURE Windows_CriticalEnd;
{
PURPOSE : Enables task switchin in Windows 3.0+
SEE ALSO : Windows_CriticalBegin
}
PROCEDURE Windows_Release;
{
PURPOSE : Releases the current timeslice to the operating system.
NOTES : This call is supported by Windows 3.0+, DOS 5+, DPMI 1.0+,
and OS/2 2.0+ for multitasking DOS applications. Windows
applications should not use this function.
SEE ALSO : Release, DOS_Release, DoubleDOS_Release, TopView_Release
}
FUNCTION Windows_Version:Word;
{
PURPOSE : Returns the current Windows version.
NOTES : The major version is returned in the low byte; the minor
version is returned in the high byte. The function is
unable to detect the exact version of Windows/386 2.x.
All 2.x versions are returned as 2.0.
SEE ALSO : DesqView_Version, DOS_Version, DoubleDOS_Version, OS2_Version,
TopView_Version
}
FUNCTION Windows_Real:Boolean;
{
PURPOSE : Returns TRUE if Windows is running in standard (real) mode.
SEE ALSO : DesqView, DOSShell, DoubleDOS, OS2, TopView, Windows
}
FUNCTION ForceFalse:Boolean;
{
PURPOSE : Always returns FALSE.
SEE ALSO : ForceTrue, NullProc
}
FUNCTION ForceTrue:Boolean;
{
PURPOSE : Always returns TRUE.
SEE ALSO : ForceFalse, NullProc
}
PROCEDURE NullProc;
{
PURPOSE : Does nothing.
SEE ALSO : ForceFalse, ForceTrue
}
PROCEDURE Release;
{
PURPOSE : Releases the current timeslice back to the operating system.
NOTES : This procedure merely calls Tasker[MT].Release, where MT
is a byte indentifying the operating system:
_DOS = 0;
_DesqView = 1;
_DoubleDOS = 2;
_OS2 = 3;
_TopView = 4;
_Windows = 5;
It is more efficient to caller Tasker[MT].Release, although
not much more efficient. You may also force Concerto to
use a different method:
Example: Tasker[_Windows].Release
Example: Tasker[_TopView].Release
SEE ALSO : DOS_Release, DoubleDOS_Release, TopView_Release, Windows_Release
}
TYPE
tMultiTasker = RECORD
Detected : FUNCTION:Boolean;
CriticalBegin : PROCEDURE;
CriticalEnd : PROCEDURE;
Release : PROCEDURE;
Version : FUNCTION:Word;
END;
CONST
MT : Byte = 0;
Tasker : ARRAY[0..5] OF tMultiTasker =
{ DOS }
(( Detected : ForceTrue;
CriticalBegin : NullProc;
CriticalEnd : NullProc;
Release : DOS_Release;
Version : DOS_Ve